/**
 * render list
 * 
 * @param {}
 *            value
 * @param {}
 *            cellmeta
 * @param {}
 *            record
 * @param {}
 *            rowIndex
 * @param {}
 *            columnIndex
 * @param {}
 *            store
 * @return {}
 */
function cms_category_list(value, cellmeta, record, rowIndex, columnIndex,
		store, gridId) {
	var cm = getGridCm(gridId);
	var fieldName = cm.getDataIndex(columnIndex);
	if (fieldName == 'D_DATE') {
		return formatTime(value);
	} else if (fieldName == 'SP') {
		return '<a href="javascript:void(0);" onclick="javascript:editCatalog(\''
				+ record.data['PK_ID']
				+ '\', \''
				+ record.data['D_NAME']
				+ '\');">编辑</a>&nbsp;<a href="javascript:void(0);" onclick="javascript:delCatalog(\''
				+ record.data['PK_ID']
				+ '\', \''
				+ record.data['D_NAME']
				+ '\');">删除</a>'
				+ '&nbsp;<a href="javascript:void(0);" onclick="javascript:addcmsinfo(\'cms_category_list\',\''
				+ record.data['PK_ID']
				+ '\', \''
				+ record.data['D_NAME']
				+ '\', \'category\');">内容发布</a>'

	}

	return value;
}

function editCatalog(id, name) {
	var tv = new editTableView4QueryList('cms_category_list');
	tv.initTableView('cms_category_edit', id);
}

function delCatalog(id, name) {
	deleteTable('cmscategory', 'single', '-1', function(params) {
				params.PK_ID = id;
				return true;
			}, function() {
				reloadTQList('cms_category_list');
			}, null)
}